import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/Home'
import pickStock from '@/views/pickStock'
import hotNew from '@/views/hotNew'
import inStock from '@/views/inStock'
import search from '@/views/search'
import factorNews from '@/views/factorNews'
import factorSortsMore from '@/views/factorSortsMore'
import factorNewsMore from '@/views/factorNewsMore'
import factorHotsMore from '@/views/factorHotsMore'
import myStrategyMore from '@/views/myStrategyMore'
import strategyEdit from '@/views/strategyEdit'
import factorSortsSearch from '@/views/factorSortsSearch'
import addStock from '@/views/addStock'
import reStrategyName from '@/views/reStrategyName'
import newStrategyName from '@/views/newStrategyName'
import strategySortsMore from '@/views/strategySortsMore'
// import saveStock from '@/views/saveStock'
// import Factor from '@/components/Factor'

Vue.use(Router)

const router = new Router({
  base: '/',
  mode: 'hash', // hash history
  routes: [
    //
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    // 万能选股器---主页
    {
      path: '/pickStock',
      name: 'pickStock',
      component: pickStock,
      children: [
        {
          path: '/pickStock/factorSort'
          // component:

        },
        {
          path: '/pickStock/factorNews',
          name: 'factorNews',
          component: factorNews
        }
      ]
    },
    // 因子分类---六类
    {
      path: '/factorSortsMore',
      name: 'factorSortsMore',
      component: factorSortsMore
    },
    // 因子分类搜索---更多
    {
      path: '/factorSortsSearch',
      name: 'factorSortsSearch',
      component: factorSortsSearch
    },
    // 添加自选
    {
      path: '/addStock',
      name: 'addStock',
      component: addStock
    },
    // 保存策略
    // {
    //   path: '/saveStock',
    //   name: 'saveStock',
    //   component: saveStock
    // },
    // 最新因子---更多
    {
      path: '/factorNewsMore',
      name: 'factorNewsMore',
      component: factorNewsMore
    },
    // 热门因子---更多
    {
      path: '/factorHotsMore',
      name: 'factorHotsMore',
      component: factorHotsMore
    },
    // 我的策略---更多
    {
      path: '/myStrategyMore',
      name: 'myStrategyMore',
      component: myStrategyMore
    },
    // 热点在哪里---主页
    {
      path: '/hotNew',
      name: 'hotNew',
      component: hotNew
    },
    // 个股诊断器---主页
    {
      path: '/inStock',
      name: 'inStock',
      component: inStock
    },
    // 搜索
    {
      path: '/search',
      name: 'search',
      component: search
    },
    // 修改策略名称
    {
      path: '/reStrategyName',
      name: 'reStrategyName',
      component: reStrategyName
    },
    // 修改策略名称
    {
      path: '/newStrategyName',
      name: 'newStrategyName',
      component: newStrategyName
    },
    {
      path: '/strategySortsMore',
      name: 'strategySortsMore',
      component: strategySortsMore
    },
    // 策略编辑---
    {
      path: '/strategyEdit',
      name: 'strategyEdit',
      component: strategyEdit
    },
    // 路由重定向
    {
      path: '*',
      redirect: '/home'
    }
  ]
})

// router.beforeEach((to, from, next) => {
//   console.log(to, from, next)
// })

// router.afterEach((to, from) => {
//   console.log(to, from)
// })
export default router
